package com.project.service.Impl;

import com.project.bean.CutPagBean;
import com.project.bean.InvitationBane;
import com.project.dao.IInvitationDao;
import com.project.dao.ISpeakDao;
import com.project.service.IInvitationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;

@Service
public class invitationServiceImpl implements IInvitationService {
    @Autowired
    private IInvitationDao dao;
    @Autowired
    private ISpeakDao dao2;

    @Override
    public CutPagBean<InvitationBane> findByItem(Integer pageNo, Integer chId, String name, String author, LocalDate startDate, LocalDate endDate) {
      return  dao.findByItem(pageNo,chId,name,author,startDate,endDate);
    }

    @Override
    public void addInvitation(InvitationBane in ) {
        dao.addInvitation(in);
    }

    @Override
    public InvitationBane findById(Integer id) {
        InvitationBane in = dao.findById(id);
        in.setList(dao2.findAll(id));
        return in;
    }


}
